package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.FaDoorlogMapper;
import com.ruoyi.system.domain.FaDoorlog;
import com.ruoyi.system.service.IFaDoorlogService;
import com.ruoyi.common.core.text.Convert;

/**
 * 考勤记录Service业务层处理
 * 
 * @author xiaohe
 * @date 2024-11-13
 */
@Service
public class FaDoorlogServiceImpl implements IFaDoorlogService 
{
    @Autowired
    private FaDoorlogMapper faDoorlogMapper;

    /**
     * 查询考勤记录
     * 
     * @param id 考勤记录主键
     * @return 考勤记录
     */
    @Override
    public FaDoorlog selectFaDoorlogById(Long id)
    {
        return faDoorlogMapper.selectFaDoorlogById(id);
    }

    /**
     * 查询考勤记录列表
     * 
     * @param faDoorlog 考勤记录
     * @return 考勤记录
     */
    @Override
    public List<FaDoorlog> selectFaDoorlogList(FaDoorlog faDoorlog)
    {
        return faDoorlogMapper.selectFaDoorlogList(faDoorlog);
    }

    /**
     * 新增考勤记录
     * 
     * @param faDoorlog 考勤记录
     * @return 结果
     */
    @Override
    public int insertFaDoorlog(FaDoorlog faDoorlog)
    {
        faDoorlog.setCreateTime(DateUtils.getNowDate());
        return faDoorlogMapper.insertFaDoorlog(faDoorlog);
    }

    /**
     * 修改考勤记录
     * 
     * @param faDoorlog 考勤记录
     * @return 结果
     */
    @Override
    public int updateFaDoorlog(FaDoorlog faDoorlog)
    {
        faDoorlog.setUpdateTime(DateUtils.getNowDate());
        return faDoorlogMapper.updateFaDoorlog(faDoorlog);
    }

    /**
     * 批量删除考勤记录
     * 
     * @param ids 需要删除的考勤记录主键
     * @return 结果
     */
    @Override
    public int deleteFaDoorlogByIds(String ids)
    {
        return faDoorlogMapper.deleteFaDoorlogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除考勤记录信息
     * 
     * @param id 考勤记录主键
     * @return 结果
     */
    @Override
    public int deleteFaDoorlogById(Long id)
    {
        return faDoorlogMapper.deleteFaDoorlogById(id);
    }
}
